#ifndef TEXTBUDDY_H_
#define TEXTBUDDY_H_


#include <iostream>
#include <string>

using namespace std;

class TextBuddy{

	static const string ERROR_NO_FILENAME;
	static const string ERROR_INVALID_FILENAME;
	static const string ERROR_INVALID_COMMAND;
	static const string ERROR_SORT_EMPTYFILE;

	static const string COMMAND_ADD;
	static const string COMMAND_DISPLAY;
	static const string COMMAND_CLEAR;
	static const string COMMAND_DELETE;
	static const string COMMAND_EXIT;
	static const string COMMAND_SORT;
	static const string COMMAND_SEARCH;

	static const string MESSAGE_COMMAND;
	static const string MESSAGE_NO_SEARCH_RESULT;
	static const string MESSAGE_SORTED;
	static const string FILENAME_TEMPORARY;

public:
	static string throwErrorMessage(string error);
	static void checkIfNoArguments(int argc);
	static void checkIfInvalidFileName(char* argv[]);
	static void checkIfInvalidArguments(int argc,char* argv[]);
	static string add(string line,char* argv[]);
	static vector<string> getFileContent(char* argv[]);
	static string display(char* argv[]);
	static string clear(char* argv[]);
	static void checkIfLineNumberDoesNotExist(int flag, int lineNumberToDelete, char* argv[], string deletedLine);
	static void deleteLine(int lineNumberToDelete,char* argv[]);
	static string extractFirstWord (string command);
	static string extractAfterFirstWord (string command, string firstWord);
	static string getCommand();
	static string sortFileContent(char* argv[]);
	static bool checkIfFileIsEmpty(vector<string> fileContent);
	static void writeToFile(vector<string> fileContent);
	static string giveSearchResults(vector<int> lineNumbers,vector<string> fileContent);
	static string searchWord(string restString,char* argv[]);
	static void processSearch(string searchKeyword, vector<int>& lineNumbers,vector<string> fileContent);
	static void determineCommand(char* argv[], string command);
	static void executeProgram(char* argv[]);
	static void printFileReady(char* argv[]);
};

#endif